<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <meta name="renderer" content="webkit">
    <title>鼠标跟随弹出层</title>
    <meta name="description" content="">
    <meta name="keywords" content="">
    <style>
        .container{ 
            width: 1200px;
            margin: 10px auto;
            overflow: hidden;
        }
        .container div{
            float: left;
            margin-right: 10px;
            width: 100px;
            height: 100px;
            background: #eee;
        }
    </style>
</head>
<body>
    <div class="container">
        <h2>使用案例</h2>
        <div id="demo1"></div>
    </div>
    <div class="container">
        <h2>使用jQuery</h2>
        <div class="demo"></div>
        <div class="demo"></div>
    </div>

    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <script src="./js/followPopup.js"></script>
    <script type="text/javascript">
        // 原生版
        new FollowPopup(document.getElementById('demo1'), {
            html: '<div>隐藏的内容跟随鼠标一起动...</div>',
            afterEnter: function(el, popup) {
                console.log(el, popup);
            }
        });
        // jQuery版
        $('.demo').followPopup({
            html: '<div>隐藏的内容跟随鼠标一起动...</div>',
            afterEnter: function(el, popup) {
                console.log(el, popup);
            }
        })
    </script>
</body>
</html>
